//
//  linear_flight_timer.cpp
// ~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2013-2014 Razvan Coca (razvan dot coca at  gmail dot com)
// This is mostly generated code. Generator is distributed under GPL. Edit it to suit your needs.
// 



#include "linear_flight_timer.hpp"
#include <boost/bind.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/enable_shared_from_this.hpp>
#include <boost/asio.hpp>

#include "patterns/command.hpp"
#include "patterns/handlers.hpp"

#include "logging/logging.hpp"

namespace pcmd=patterns::command;
namespace phdl=patterns::handlers;
namespace ba=boost::asio;
namespace bs=boost::system;
namespace bt=boost::posix_time;


#include "components/utils/linear_flight_timer.hpp"
namespace components{
namespace utils{


bool linear_flight_timer::cancel()
{

    try{
        bool retcode=true;
        LOG(WARNING)<<name_<<"::"<<__FUNCTION__;
        timer_.cancel();
        return retcode;
    }
    catch(std::exception &e){
        LOG(WARNING)<<name_<<"::"<<__FUNCTION__<<":"<<e.what();
        return false;
    }

}

boost::shared_ptr<linear_flight_timer> linear_flight_timer::create(ba::io_service& ios_master)
{

    return boost::shared_ptr<linear_flight_timer>(new linear_flight_timer(ios_master));
}

linear_flight_timer::linear_flight_timer(ba::io_service& ios_master)
    :ios_master_(ios_master),timer_(ios_master_)
{
    name_=std::string(__FUNCTION__);
    DLOG(INFO)<<name_<<"()";
}

linear_flight_timer::~linear_flight_timer()
{
    DLOG(INFO)<<name_<<"::"<<__FUNCTION__<<std::endl;
}
}//end namespace utils
}//end namespace components

